class CalciumCorrectionInHypoalbuminemia():
    def __init__(self):
        # http://doctor-network.com/public/littletools/52.html
        pass

    def calc(self, data):
        """
        低白蛋白血症时钙浓度的校正
        """
        serum_calcium = float(data['serum_calcium'])  # 血清钙离子
        serum_albumin = float(data['serum_albumin'])  # 白蛋白
        if data['type'] == "国际单位":
            return serum_calcium + 0.02 * (40 - serum_albumin)
        else:
            return serum_calcium + 0.8 * (4 - serum_albumin)


if __name__ == '__main__':
    print(CalciumCorrectionInHypoalbuminemia().calc({"serum_calcium": "75", "serum_albumin": "26", "type": "国际单位"}))
